package com.iman.sumer.vo.student;

import java.util.Date;


public class StudyDmsgVo {
	private String userName;
	private Long courseId;
	private String courseNm;
	private Date operaterDt;
	private Long categoryId;
	private String categoryNm;
	private Integer operaterTp;
	private String userHimg;
	
	private int timeType;
	private int timeLong;
	
	public int getTimeType() {
		return timeType;
	}
	public void setTimeType(int timeType) {
		this.timeType = timeType;
	}
	public int getTimeLong() {
		return timeLong;
	}
	public void setTimeLong(int timeLong) {
		this.timeLong = timeLong;
	}
	
	public long getOperaterDt() {
		return operaterDt.getTime();
	}
	public void setOperaterDt(Date operaterDt) {
		long lastTime = operaterDt.getTime();
		long nowTime = System.currentTimeMillis();
		int min = (int) ((nowTime - lastTime)/1000/60);
		if(min < 60){
			timeType = 0;
			timeLong =  min;
		}else if(min > 1440){
			timeType = 2;
			timeLong = min/1440;
		}else {
			timeType = 1;
			timeLong = min/60;
		}
		this.operaterDt = operaterDt;
	}
	
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	public String getCourseNm() {
		return courseNm;
	}
	public void setCourseNm(String courseNm) {
		this.courseNm = courseNm;
	}
	public String getCategoryNm() {
		return categoryNm;
	}
	public void setCategoryNm(String categoryNm) {
		this.categoryNm = categoryNm;
	}
	public Integer getOperaterTp() {
		return operaterTp;
	}
	public void setOperaterTp(Integer operaterTp) {
		this.operaterTp = operaterTp;
	}
	@Override
	public String toString() {
		return "StudyDmsgVo [userName=" + userName + ", courseId=" + courseId
				+ ", courseNm=" + courseNm + ", operaterDt=" + operaterDt
				+ ", categoryId=" + categoryId + ", categoryNm=" + categoryNm
				+ ", operaterTp=" + operaterTp + ", userHimg=" + userHimg + "]";
	}
	public String getUserHimg() {
		return userHimg;
	}
	public void setUserHimg(String userHimg) {
		this.userHimg = userHimg;
	}
	public Long getCourseId() {
		return courseId;
	}
	public void setCourseId(Long courseId) {
		this.courseId = courseId;
	}
	public Long getCategoryId() {
		return categoryId;
	}
	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}
}
